#pragma once
#include "resource.h"
#include "DrawFunc.h"
class CSettingItem
{
public:
	static CSettingItem * CreateInstance();

	void SetPath(const CString & strPath){m_strPath = strPath;};
	CString GetPath(){return m_strPath;};

	void SetImageType(IMAGE_TYPE eType){m_eImageType = eType;};
	IMAGE_TYPE GetImageType(){return m_eImageType;};

	void SetCtrlCMode(BOOL bCtrlC){m_bCtrlC = bCtrlC;};
	BOOL GetCtrlCMode(){return m_bCtrlC;};
		
	void		WriteConfig(const CString & strFilePath);
private:
	CSettingItem();
	~CSettingItem();
	
	void		ReadConfig(const CString & strFilePath);


	CString		m_strPath;
	IMAGE_TYPE	m_eImageType;
	BOOL		m_bCtrlC;
};

class CSetDlg : public CDialogImpl<CSetDlg>, public CWinDataExchange<CSetDlg>
{
public:
	CSetDlg(void);
	~CSetDlg(void);

	enum {IDD = IDD_SETDLG};

	virtual BOOL PreTranslateMessage(MSG* pMsg)
	{
		return CWindow::IsDialogMessage(pMsg);
	}

	BEGIN_DDX_MAP(CSetDlg)
		DDX_TEXT(IDC_EDIT_PATH, m_strPath)
	END_DDX_MAP()


	BEGIN_MSG_MAP(CSetDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_ID_HANDLER(IDOK, OnOK)
		COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		COMMAND_ID_HANDLER(IDC_BUTTON_BROWSE, OnBrowse)
	END_MSG_MAP()

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

	LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnBrowse(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
private:
	CString m_strPath;

};
